﻿using Common.Framework.Core.Common;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Framework.Core.Minio
{
    public interface IMinioService
    {
        /// <summary>
        /// 上传文件
        /// </summary>
        /// <param name="file"></param>
        /// <param name="filePath"></param>
        /// <param name="newFileName"></param>
        /// <param name="removeOldFileName"></param>
        /// <returns></returns>
        Task<ServiceResult<MinioFileModel>> UploadAsync(FormFileCollection file, string filePath = null, string newFileName = null, string removeOldFileName = "");
        /// <summary>
        /// 上传文件
        /// </summary>
        /// <param name="file"></param>
        /// <param name="filePath"></param>
        /// <param name="newFileName"></param>
        /// <param name="removeOldFileName"></param>
        /// <returns></returns>
        Task<ServiceResult<MinioFileModel>> UploadAsync(IFormFile file, string filePath = null, string newFileName = null, string removeOldFileName = "");
        /// <summary>
        /// 上传文件,每次只能上传一个文件,只接受文件流
        /// </summary>
        /// <param name="stream"></param>
        /// <param name="oldFileName"></param>
        /// <param name="fileLength"></param>
        /// <param name="fileContentType"></param>
        /// <param name="filePath"></param>
        /// <param name="newFileName"></param>
        /// <param name="removeOldFileName"></param>
        /// <returns></returns>
        Task<ServiceResult<MinioFileModel>> UploadStreamAsync(Stream stream, string oldFileName, long fileLength, string fileContentType, string filePath = null, string newFileName = null, string removeOldFileName = "");

        /// <summary>
        /// 
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        Task<ServiceResult<bool>> RemoveObjectAsync(string fileName);
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fileNames"></param>
        /// <returns></returns>
        Task<ServiceResult<bool>> RemoveObjectsAsync(List<string> fileNames);
    }
}
